home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Small Eiffel 0.4.8 / lib_show / bench5 / bench.e < prev    next >
Encoding:
Text File  |  1997-04-13  |  956 b   |  51 lines  |  [TEXT/ttxt]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. deferred class BENCH
  5.    --
  6.    -- Comparison : `add_first' for  ARRAY, FIXED_ARRAY, LINK_LIST 
  7.    --                               and LINK2_LIST.
  8.    --
  9.  
  10. feature
  11.  
  12.    -- According to the power of your computer, set `tuning'
  13.    -- to a good positive value. Default is for very small 
  14.    -- computer :
  15.    tuning: INTEGER is 1; -- 6000;
  16.  
  17. feature {NONE}
  18.  
  19.    frozen bench(cltn: COLLECTION[INTEGER]) is
  20.       require
  21.      cltn.count = 0
  22.       local
  23.      i: INTEGER;
  24.       do
  25.      from
  26.         i := tuning + 5;
  27.      until
  28.         i = 0
  29.      loop
  30.         cltn.add_first(i);
  31.         check
  32.            cltn.item(cltn.lower) = i
  33.         end;
  34.         i := i - 1;
  35.      end;
  36.      debug
  37.         from
  38.            i := cltn.upper - 1;
  39.         until
  40.            i < cltn.lower
  41.         loop
  42.            check
  43.           cltn.item(i) = cltn.item(i + 1) - 1
  44.            end;
  45.            i := i - 1;
  46.         end;
  47.      end;
  48.       end;
  49.  
  50. end
  51.